//
//  WebViewController.swift
//  Yun
//
//  Created by 新宝 on 2017/6/15.
//  Copyright © 2017年 新宝. All rights reserved.
//

import UIKit

class WebViewController: UIViewController {
let webView=UIWebView()
let navigationView=UIView()
let button=UIButton()
open var urlString:String?
    
override func viewDidLoad() {
        super.viewDidLoad()
        webView.delegate=self as? UIWebViewDelegate
        webView.frame=CGRect(x:0,y:65,width:self.view.frame.size.width,height:self.view.frame.size.height)
        webView.scalesPageToFit=true
        self.view.addSubview(webView)
        webView.loadRequest(URLRequest(url:NSURL(string:urlString!)! as URL))
    
    button.frame=CGRect(x:0,y:26,width:50,height:30)
    button.setTitle(" 返回", for: .normal)
    button.addTarget(self, action: #selector(WebViewController.buttonClick), for: .allTouchEvents)
    navigationView.frame=CGRect(x:0,y:0,width:self.view.frame.size.width,height:65)
    navigationView.backgroundColor=UIColor.blue
    navigationView.addSubview(button)
    self.view.addSubview(navigationView)
        
        
        
}

    func buttonClick(){
    
        self.dismiss(animated: true, completion: nil)
        
    }
    
    
    
    
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    
}
